<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <div>
    <forme :date="formData"></forme>
   
  </div>
</template>

<script>
import forme from '@/form.vue'

export default {
    components:{
        forme
    },
    data(){
      return{
        formData:{
          width:'100px',
          rules:{
            name: [
            { required: true, message: '请输入活动名称', trigger: 'blur' },
            { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
          ],
          region: [
            { required: true, message: '请选择活动区域', trigger: 'change' }
          ],
          date1: [
            { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
          ],
          date2: [
            { type: 'date', required: true, message: '请选择时间', trigger: 'change' }
          ],
          type: [
            { type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }
          ],
          resource: [
            { required: true, message: '请选择活动资源', trigger: 'change' }
          ],
          desc: [
            { required: true, message: '请填写活动形式', trigger: 'blur' }
          ]
          },
          items:[
          {
            type:'Input',
            label:'活动名称',
            prop:'name',
            placeholder:'请选择活动名称',
            width:'200px'
          },
          {
            type:'Select',
            label:'活动区域',
            placeholder:'请选择活动范围',
            prop:'region',
            default:'1',
            option:[{
              label:'上海',
              value:'1'
            },
            {
              label:'北京',
              value:'2'
            }
          ]
          },
          {
            type:'Switch',
            label:'及时配送',
            prop:'delivery',
            default:true,
          },
          {
            type:'Checkbox',
            label:'活动性质',
            prop:'type',
            default:'1',
            checkbox:[
              {
                label:'美食/餐厅线上活动',
                value:'1'
              },
              {
                label:'地推活动',
                value:'2'
              },
              {
                label:'线下主题活动',
                value:'3'
              },
              {
                label:'单纯品牌曝光',
                value:'4'
              }
            ]
          },
          {
            type:'Radio',
            label:'特殊资源',
            prop:'resource',
            default:'a',
            radio:[
              {
                label:'线上品牌商赞助',
                value:'a'
              },
              {
                label:'线下场地免费',
                value:'b'
              }
            ]
          },
          {
            type:'Text',
            label:'活动形式',
            prop:'textarea',
            placeholder:'请输入活动形式',
            span:10
          },
          {
            type:'Date',
            label:'活动日期',
            prop:'date1',
            default:'2022-8-31',
            span:10
          },
          {
            type:'Time',
            label:'活动时间',
            prop:'date2',
            default:'2022-08-31 15:22:02',
            span:10
          },
          {
            type:'Datetime',
            label:'活动时间日期',
            prop:'date3',
            span:10,
            default:'2022-08-31 15:22:02'
          }
        ],
        buttons:[{
          type:'primary',
          label:'提交',
          action:'submit',
          call(data){
            console.log(data)
          }
        },
        {
          type:'primary',
          label:'重置',
          action:'reset',
          call(){
            
          }
        },
        {
          type:'primary',
          label:'其他'
        },
      ]

        }
        
      }
    }
}
</script>

<style>

</style>